<!-- #include file="conectar.asp" -->
<%
	AbreBanco()
	set rs = server.createobject("ADODB.Recordset")	
	dim sql
	if request("p") <> "" then sql = sql & " and periodo = '" & request("p") & "'"
	sql = "SELECT Tb_Exclusao.* FROM Tb_Exclusao WHERE 1=1"& sql &"ORDER BY Dt_exclusao"
	rs.open sql,banco,3,3
	while not rs.eof
%>
<table>
	<tr align="center" bgcolor="#DDDDDD">
		<%
					
			if(Len(rs(2)) = 5) then
				Response.Write "permanente"
			else
				Response.Write "pontual"
			end if
		%>
	
		<td><%=rs(2)%></td>
	</tr>
</table>
<%
		rs.movenext
	wend
	
	function datas(data_inicial,data_final)
		diferenca = DateDiff("d",data_inicial,data_final)
		dia = WeekDay(data_inicial)
		weekend = 0
		
		for contador = 0 to diferenca
			if dia = 1 then weekend = weekend + 1
			if dia = 7 then weekend = weekend + 1
			
			dia = dia + 1
			if dia > 7 then dia = 1
		next
		datas = weekend
	end function
	
	ex = datas("01/08/2011","10/08/2011")
	Response.Write ex
%>